package com.shelpe.services.algorithm.entity.mongo;

import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;

@Data
@Document(collection="keyword_ranks")
public class KeywordRank {
	@Id
	private String id;
	
	@JsonProperty("searcher_user_id")
	private long userID;
	@JsonProperty("searcher_user_id")
	private String nick;
	
	@Indexed
	@JsonProperty("searcher_keyword_id")
	private long keywordID;
	@Indexed
	@JsonProperty("searcher_keyword")
	private String keyword;
	
	
	private KeywordRankItem rank;
	
	@JsonProperty("created_time")
	private Date createdTime;
	@JsonProperty("modified_time")
	private Date modifiedTime;
	
	@Data
	public static class KeywordRankItem{
		@Indexed
		private String nick;
		@JsonProperty("product_id")
		
		@Indexed
		private long productID;
		private int order;
		@JsonProperty("max_price")
		private String maxPrice;
		private String title;
		@JsonProperty("link_url")
		private String linkUrl;
		@JsonProperty("rank_score")
		private int rankScore;
	}
	
}
